package com.glx.test.utils;

import org.apache.commons.codec.digest.DigestUtils;
import org.springframework.stereotype.Component;

@Component
public class Md5Utils {
    //设置Salt
    private static final String salt = "gugubird0204";

    //MD5加密
    public static String md5(String str) {
        return DigestUtils.md5Hex(str);
    }

    //密码加密
    public static String md5Password(String password) {
        String str = salt.charAt(0) + salt.charAt(2) + password + salt.charAt(5) + salt.charAt(4);
        return md5(str);
    }


}
